<template>
	<view class="voteList">
		<view class="info_item" v-for="(item, index) in dataList" :key="index" @click="goDetail(item)">
			<view class="item_img">
				<image :src="item.img.split(',')[0]" mode="aspectFill"></image>
			</view>
			<view class="details">
				<view class="title u-line-2">{{item.name}}</view>
				<view class="video-bottom">
					<view class="detail_time">{{item.start_date | format}}</view>
					<view class="see_tem see_main">{{item.view_count}}投票</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		configMixin
	} from './configMixin.js';
	import {
		formatDate
	} from '@/utils/moment/index.js';
	export default {
		mixins: [configMixin],
		filters: {
			format(data, str = 'YYYY/MM/DD') {
				return formatDate(data, str);
			}
		},
		data() {
			return {

			}
		},
		methods:{
			goDetail (item) {
				this.$linkTo(`/package/activity/vote/index?id=${item.pk_id}`)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.voteList {
		background-color: #fff;
		padding: 0 30rpx 0;

		.info_item {
			width: 100%;
			display: flex;
			padding: 28rpx 0;
			border-bottom: 1rpx solid #f1f1f1;

			&:last-of-type {
				border: none;
			}

			.item_img {
				width: 230rpx;
				height: 148rpx;
				margin-right: 18rpx;
				border-radius: 10rpx;
				overflow: hidden;
			}

			.see_tem {
				display: flex;
				align-items: center;
			}

			.details {
				width: 80%;
				display: flex;
				flex-direction: column;
				justify-content: space-between;

				.video-bottom {
					width: 100%;
					display: flex;
					align-items: center;
					justify-content: space-between;
				}
			}

		}
	}
</style>
